package com.woniuxy.cloud;


import com.woniuxy.cloud.demo.Result;
import com.woniuxy.cloud.dto.AreaDto;
import com.woniuxy.cloud.param.initiationAreaParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author 周川雄
 * @date 2022/1/26 22:59
 */
@FeignClient(value = "area", path = "sys-area")
public interface AreaQueryAPI {

    @PostMapping("getAreaById.do")
    AreaDto getAreaById(@RequestParam("areaId") Integer areaId);

    /**
     * 查询指定区域
     *
     * @param areaId
     * @return
     */
    @PostMapping("listArea.do")
    Result<AreaDto> listArea(@RequestParam("areaId") Integer areaId);

    /**
     * 查询指定可用区域
     *
     * @param areaId
     * @return
     */
    @PostMapping("listInitiationArea.do")
    Result<AreaDto> listInitiationArea(@RequestParam("areaId") Integer areaId);

    /**
     * 改变区域权限(1开启权限,0关闭权限)
     *
     * @param param
     * @param result
     * @return
     */
    @PostMapping("initiationArea.do")
    Result initiationArea(@RequestBody @Validated initiationAreaParam param, BindingResult result);


}
